﻿using System;
using System.Web.Script.Serialization;
using IPCChannel;

namespace UProveAPI
{
    public enum IssuanceDataType
    {
        InitalizeIssuance,
        FirstIssuance,
        SecondIssuance,
        FinalIssuance,
    }

    [Serializable]
    public class IssuanceMessage : IPCMessage
    {
        public IssuanceDataType DataType;
        public byte[] ProverInformation;
        public byte[] TokenInformation;
        public byte[][] Attributes;
        public int TokenCount;
        public string JSONData;

        public IssuanceMessage()
            : base(IPCMessageTypes.IssuanceMessage)
        {
        }

        public IssuanceMessage(IssuanceDataType dataType)
            : base(IPCMessageTypes.IssuanceMessage)
        {
            DataType = dataType;
        }

        public override string Serialize()
        {
            return new JavaScriptSerializer().Serialize(this);
        }
    }
}
